home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 5-7 / Prograph Reference 5-7.rsrc / TEXT_156.txt < prev    next >
Encoding:
Text File  |  1995-10-25  |  2.5 KB  |  52 lines

  1.  
  2. Byte Stream
  3.  
  4. Data clustering provides a means of packaging an arbitrary collection of Prograph objects (including handles to Macintosh structures) into byte streams, suitable for storage in disk files or transmission between applications or machines. This mechanism is used internally by Prograph, by the Datafile Manager and by the load and save primitives.
  5.  
  6. The data clustering facility is available through the primitives to-bytes, from-bytes, and clear-bytes-map. These primitives are useful in implementing applications dealing with IAC, LocalTalk, communications and resource management.
  7.  
  8.  
  9. _________________________________________________
  10.  
  11.                                                  clear-bytes-map    *263*
  12.  
  13.  
  14. Input types:    ABlock@@
  15.  
  16. Description:     A class translation map contains the names and addresses of classes of values packaged in a cluster generated by to-bytes. However, if the data has been transmitted to an application or read into a new application, the addresses of the classes stored in the map will be invalid. clear-bytes-map will flag all class addresses stored in the map as invalid, forcing from-bytes to look up the correct class addresses. Unless you are sure of the validity of the map, call clear-bytes-map prior to from-bytes (this slows down translation time).
  17.  
  18. See also: to-bytes, from-bytes
  19.  
  20.  
  21. _________________________________________________
  22.  
  23.                              from-bytes     *264*
  24.  
  25.  
  26.  
  27. Input types:    ABlock@@; ABlock@@
  28.  
  29. Output types:    integer; any
  30.  
  31. Description:  Takes a handle of bytes originally generated by to-bytes and reconstitutes the bytes into their original Prograph data values. The class translation map used to construct the handle must also be provided.
  32.  
  33. See also:    to-bytes, clear-bytes-map
  34.  
  35.  
  36. _________________________________________________
  37.  
  38.                                       to-bytes     *264*
  39.  
  40.  
  41.  
  42. Input names: Value; [OldMap]
  43.  
  44. Input types: any; [ABlock@@]
  45.  
  46. Output types: ABlock@@; ABlock@@
  47.  
  48. Description:  Takes an arbitrary Prograph data object and generates a handle of bytes (cluster). The contents of the handle generated by to-bytes can then be written to disk, stored as a resource, placed in the scrapbook or clipboard, or transmitted to another application via IAC. to-bytes also generates a second handle of bytes containing a class translation map. This map contains information necessary to remap objects into their appropriate classes. Since the same map could be applied to several values, it is kept separate and thereby reduces the number of bytes necessary to represent large data sets.
  49.  
  50. See also:    from-bytes, clear-bytes-map
  51.  
  52.